package org.example.springwebmvc.service;

import org.example.springwebmvc.mapper.MessageInfoMapper;
import org.example.springwebmvc.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName MessageService
 * @Description
 * @Author ZJX
 * @Date 2024/8/26 21:24
 * @Version 1.0
 */
@Service
public class MessageService {

    @Autowired
    private MessageInfoMapper messageInfoMapper;

    public Integer publish(MessageInfo messageInfo) {
        return messageInfoMapper.insertMessage(messageInfo);
    }

    public List<MessageInfo> getMessageList(){
        return messageInfoMapper.selectAllList();
    }
}
